# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-virtualenv
_pkgname=virtualenv
pkgver=20.13.0
pkgrel=2
pkgdesc='Virtual Python Environment builder.'
url='https://pypi.org/project/virtualenv/#files'
arch=('any')
license=('MIT')
depends=('python2' 'python2-platformdirs' 'python2-distlib' 'python2-filelock'
         'python2-six' 'python2-importlib-metadata'
         'python2-importlib_resources' 'python2-pathlib2'
         'python2-backports.entry-points-selectable')
makedepends=('python2-pip' 'python2-setuptools' 'python2-setuptools-scm')
replaces=('virtualenv')
conflicts=('virtualenv')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('72aa8cffe92551479ad4ec93395597cd9f77ddaf2063e36d5836277199a96ab2d57236d94b99b7038a60ada103a2d8a37ae4b13ffaaa6ed8e786245d9fbbf6d6')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/bin/$_pkgname" "$pkgdir/usr/bin/${_pkgname}2"
}

